local console = ac.console
--小地图
local ui = class.panel.create([[ui\按钮.tga]],110,40,145,104)
ui:set_level(99)
ac.wait(200,function()
    japi.DzFrameEditBlackBorders(30/1080,120/1080)
    local ui = class.panel:builder{
        parent = class.ui_base.portrait,
        normal_image = [[UI\Console\back.tga]],
        w = 1920,
        h = 512,
    }
    ui:set_real_position(0,1080-ui.h)
end)

--天赋栏
local old_ui = require '界面.地图界面.选择天赋.拥有面板'
local button = require '界面.地图界面.选择天赋.吞噬面板'
local x1,y1 = 320,860
local g1,g2 = 13.5,11
local w,h = 58,44
old_ui.title:set_text('')
old_ui.select:set_control_size(w,h)
button:set_position(old_ui.x + (old_ui.w - button.w)/2 - 15,old_ui.y-60)
for i,panel in ipairs(old_ui.panels) do
    local a,b = math.ceil(i/3),(i-1)%3 + 1
    local x,y = (b-1)*(w + g1),(a-1)*(h+g2)
    panel:set_real_position(x + x1,y + y1)
    panel:set_relative_w(w/panel.w)
    panel:set_relative_h(h/panel.h)
end

--血条显示
local old_ui = require '界面.基础界面.血量模拟'
old_ui:set_position(580,old_ui.y)


--属性栏
local old_ui = require '界面.基础界面.属性面板'
old_ui.unitdetail:set_real_position(90,0)
old_ui.herodetail:set_real_position(90,0)
old_ui.unitdetail.title:set_position(old_ui.unitdetail.title.x,old_ui.unitdetail.title.y-9)

--物品框
local x1,y1 = 1370,902
local g1,g2 = 22,14
local w,h = 60,48

for i,panel in ipairs(console.itemdetail) do
    local a,b = math.ceil(i/2),(i-1)%2 + 1
    local x,y = (b-1)*(w + g1),(a-1)*(h+g2)
    panel:set_control_size(w,h)
    panel:set_position(x + x1,y + y1)
    --panel:add_panel('')
    ac.wait(10,function()
        local button = console.item[i]
        button:set_control_size(w,h)
        button:set_position(panel.x,panel.y)
    end)
end



--技能栏
local slots = {9,10,11,12,5,6,7,8,1,2,3,4}
local x1,y1 = 1572,880
local g1,g2 = 16,11
local w,h = 72,56

for i,panel in ipairs(console.abilitydetail) do
    local a,b = math.ceil(i/4),(i-1)%4 + 1
    local x,y = (b-1)*(w + g1),(a-1)*(h+g2)
    panel:set_control_size(w,h)
    panel:set_position(x + x1,y + y1)
    if panel.effect_button then
        panel.effect_button:set_relative_w(w/panel.effect_button.w)
        panel.effect_button:set_relative_h(h/panel.effect_button.h)
    end
    ac.wait(10,function()
        local button = console.ability[i]
        button:set_control_size(w,h)
        button:set_position(panel.x,panel.y)
    end)
end
